package com.comm;

import javax.script.*;

public class JavaScriptEvalHelper {
	public static void eval(String code) {
		ScriptEngine jse = new ScriptEngineManager().getEngineByName("JavaScript");
		try {
			String result = String.valueOf(jse.eval(code));
			System.out.println(result);
		} catch (ScriptException e) {
			e.printStackTrace();
		}
	}
}
